public class 回顾2 {
    public static void main(String[] args) {
        int [] arr={1,2,5,8,24,54,64,67,84,98,};
    int  []li =getmax(arr);
        System.out.println(li[0]);
        System.out.println(li[1]);
    }

    public static int [] getmax(int[]arr) {
        int max=arr[0];
        for (int i = 0; i < arr.length; i++){
            if (arr[i]>max){
                max=arr[i];
            }
        }
        int min=arr[0];
        for (int i = 0; i < arr.length; i++){
            if (arr[i]<min){
                min=arr[i];
            }
        }

   int []minmax={min,max};
    return minmax;


    }




}
